//
//  LDFinderListMessageVC.swift
//  DingDongZP
//
//  Created by 三秒文化 on 16/6/2.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

import UIKit

class LDFinderListMessageVC: RCConversationListViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        setDisplayConversationTypes([RCConversationType.ConversationType_PRIVATE.rawValue])
        conversationListTableView.separatorColor = LDIconColor.LightGray
        conversationListTableView.tableFooterView = UIView()
        conversationListTableView.backgroundColor = LDGolbalColor.BgGoundGray
        navigationItem.title = "消息"
        showConnectingStatusOnNavigatorBar = true
        setConversationAvatarStyle(.USER_AVATAR_CYCLE)
        
        
        let headView = LDMessageNotiHeadView()
        headView.frame = CGRectMake(0, 0, LDFrame.ScreenWidth, 110)
        
        headView.tapHeadView { 
            print("点击header")
        }
        emptyConversationView = UIView()
        conversationListTableView.tableHeaderView = headView
        
    }
    
    //点击进入会话界面
    override func onSelectedTableRow(conversationModelType: RCConversationModelType, conversationModel model: RCConversationModel!, atIndexPath indexPath: NSIndexPath!) {
        if conversationModelType == RCConversationModelType.CONVERSATION_MODEL_TYPE_NORMAL {
            
            let vc = LDFinderConversationVC()
            vc.conversationType = model.conversationType
            vc.targetId = model.targetId
            vc.title = model.conversationTitle
            vc.unReadMessage = model.unreadMessageCount
            
            vc.enableNewComingMessageIcon = true//开启消息提醒
            
            
            navigationController?.pushViewController(vc, animated: true)
            
        }
    }
    
    override func willReloadTableData(dataSource: NSMutableArray!) -> NSMutableArray! {
    
        
        refreshConversationTableViewIfNeeded()
        
        return dataSource
    }
    
    
    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(true)
        rdv_tabBarController.setTabBarHidden(false, animated: true)
        
    }
    //左滑删
    override func didDeleteConversationCell(model: RCConversationModel!) {

    }
    
}
